import { tool as base64FileConverter } from './base64-file-converter';
import { tool as base64StringConverter } from './base64-string-converter';
import { tool as basicAuthGenerator } from './basic-auth-generator';
import { tool as emailNormalizer } from './email-normalizer';

import { tool as asciiTextDrawer } from './ascii-text-drawer';

import { tool as textToUnicode } from './text-to-unicode';
import { tool as safelinkDecoder } from './safelink-decoder';
import { tool as xmlToJson } from './xml-to-json';
import { tool as jsonToXml } from './json-to-xml';
import { tool as regexTester } from './regex-tester';
import { tool as regexMemo } from './regex-memo';
import { tool as markdownToHtml } from './markdown-to-html';
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
import { tool as numeronymGenerator } from './numeronym-generator';
import { tool as macAddressGenerator } from './mac-address-generator';
import { tool as textToBinary } from './text-to-binary';
import { tool as ulidGenerator } from './ulid-generator';
import { tool as ibanValidatorAndParser } from './iban-validator-and-parser';
import { tool as stringObfuscator } from './string-obfuscator';
import { tool as textDiff } from './text-diff';
import { tool as emojiPicker } from './emoji-picker';
import { tool as passwordStrengthAnalyser } from './password-strength-analyser';
import { tool as passwordGenerator } from './password-generator';
import { tool as yamlToToml } from './yaml-to-toml';
import { tool as jsonToToml } from './json-to-toml';
import { tool as tomlToYaml } from './toml-to-yaml';
import { tool as tomlToJson } from './toml-to-json';
import { tool as jsonToCsv } from './json-to-csv';
import { tool as cameraRecorder } from './camera-recorder';
import { tool as listConverter } from './list-converter';
import { tool as phoneParserAndFormatter } from './phone-parser-and-formatter';
import { tool as jsonDiff } from './json-diff';
import { tool as ipv4RangeExpander } from './ipv4-range-expander';
import { tool as httpStatusCodes } from './http-status-codes';
import { tool as yamlToJson } from './yaml-to-json-converter';
import { tool as jsonToYaml } from './json-to-yaml-converter';
import { tool as ipv6UlaGenerator } from './ipv6-ula-generator';
import { tool as ipv4AddressConverter } from './ipv4-address-converter';
import { tool as benchmarkBuilder } from './benchmark-builder';
import { tool as userAgentParser } from './user-agent-parser';
import { tool as ipv4SubnetCalculator } from './ipv4-subnet-calculator';
import { tool as dockerRunToDockerComposeConverter } from './docker-run-to-docker-compose-converter';
import { tool as htmlWysiwygEditor } from './html-wysiwyg-editor';
import { tool as rsaKeyPairGenerator } from './rsa-key-pair-generator';
import { tool as textToNatoAlphabet } from './text-to-nato-alphabet';
import { tool as slugifyString } from './slugify-string';
import { tool as keycodeInfo } from './keycode-info';
import { tool as jsonMinify } from './json-minify';
import { tool as bcrypt } from './bcrypt';
import { tool as bip39 } from './bip39-generator';
import { tool as caseConverter } from './case-converter';
import { tool as chmodCalculator } from './chmod-calculator';
import { tool as chronometer } from './chronometer';
import { tool as colorConverter } from './color-converter';
import { tool as crontabGenerator } from './crontab-generator';
import { tool as dateTimeConverter } from './date-time-converter';
import { tool as deviceInformation } from './device-information';
import { tool as cypher } from './encryption';
import { tool as etaCalculator } from './eta-calculator';
import { tool as percentageCalculator } from './percentage-calculator';
import { tool as gitMemo } from './git-memo';
import { tool as hashText } from './hash-text';
import { tool as hmacGenerator } from './hmac-generator';
import { tool as htmlEntities } from './html-entities';
import { tool as baseConverter } from './integer-base-converter';
import { tool as jsonViewer } from './json-viewer';
import { tool as jwtParser } from './jwt-parser';
import { tool as loremIpsumGenerator } from './lorem-ipsum-generator';
import { tool as mathEvaluator } from './math-evaluator';
import { tool as metaTagGenerator } from './meta-tag-generator';
import { tool as mimeTypes } from './mime-types';
import { tool as otpCodeGeneratorAndValidator } from './otp-code-generator-and-validator';
import { tool as qrCodeGenerator } from './qr-code-generator';
import { tool as wifiQrCodeGenerator } from './wifi-qr-code-generator';
import { tool as randomPortGenerator } from './random-port-generator';
import { tool as romanNumeralConverter } from './roman-numeral-converter';
import { tool as sqlPrettify } from './sql-prettify';
import { tool as svgPlaceholderGenerator } from './svg-placeholder-generator';
import { tool as temperatureConverter } from './temperature-converter';
import { tool as textStatistics } from './text-statistics';
import { tool as tokenGenerator } from './token-generator';
import type { ToolCategory } from './tools.types';
import { tool as urlEncoder } from './url-encoder';
import { tool as urlParser } from './url-parser';
import { tool as uuidGenerator } from './uuid-generator';
import { tool as macAddressLookup } from './mac-address-lookup';
import { tool as xmlFormatter } from './xml-formatter';
import { tool as yamlViewer } from './yaml-viewer';
import { tool as textKeywordRemover } from './text-keyword-remover';
import { tool as publicIpChecker } from './public-ip-checker';
import { tool as domainResolver } from './domain-resolver';
import { tool as curlCommandGenerator } from './curl-command-generator';
import { tool as nginxConfigFormatter } from './nginx-config-formatter';
import { tool as nginxFeatureConfig } from './nginx-feature-config';
import { tool as firewallRuleGenerator } from './firewall-rule-generator';
import { tool as dockerCommandGenerator } from './docker-command-generator';
import { tool as tcpdumpCommandGenerator } from './tcpdump-command-generator';

import { tool as sslCertificateParser } from './ssl-certificate-parser';
import { tool as sslCertificateGenerator } from './ssl-certificate-generator';


export const toolsByCategory: ToolCategory[] = [
    {
        name: 'Operations',
        components: [
            { ...nginxConfigFormatter, chineseName: 'Nginx 配置格式化' },
            { ...nginxFeatureConfig, chineseName: 'Nginx 功能配置' },
            { ...sslCertificateParser, chineseName: 'SSL 证书解析器' },
            { ...sslCertificateGenerator, chineseName: 'SSL 私有证书生成器' },
            { ...dockerRunToDockerComposeConverter, chineseName: 'Docker Run 到 docker-compose 转换器' },
            { ...dockerCommandGenerator, chineseName: 'Docker 命令行生成器' },
            { ...chmodCalculator, chineseName: 'Chmod 计算器' },
            { ...crontabGenerator, chineseName: 'Crontab 表达式生成' },
            { ...firewallRuleGenerator, chineseName: '防火墙规则生成器' },
        ],
    },
    {
        name: 'Network',
        components: [
            { ...curlCommandGenerator, chineseName: 'cURL 命令生成器' },
            { ...tcpdumpCommandGenerator, chineseName: 'tcpdump 命令生成器' },
            { ...domainResolver, chineseName: '域名解析器' },
            { ...publicIpChecker, chineseName: '公网IP查询器' },
            { ...ipv4SubnetCalculator, chineseName: 'IPv4子网计算器' },
            { ...ipv4RangeExpander, chineseName: 'IPv4范围扩展器' },
        ],
    },
    {
        name: 'Crypto',
        components: [
            { ...passwordGenerator, chineseName: '密码生成器' },
            { ...tokenGenerator, chineseName: 'Token 生成器' },
            { ...hashText, chineseName: 'Hash 文本' },
            { ...bcrypt, chineseName: '加密' },
            { ...uuidGenerator, chineseName: 'UUIDs 生成器' },
            // { ...ulidGenerator, chineseName: 'ULID 生成器' },
            { ...cypher, chineseName: '加密/解密文本' },
            // { ...bip39, chineseName: 'BIP39密码生成器' },
            // { ...hmacGenerator, chineseName: 'Hmac 生成器' },
            { ...rsaKeyPairGenerator, chineseName: 'RSA密钥对生成器' },
            { ...passwordStrengthAnalyser, chineseName: '密码强度分析仪' },
            // { ...pdfSignatureChecker, chineseName: 'PDF签名检查器' },
        ],
    },
    {
        name: 'Converter',
        components: [
            { ...dateTimeConverter, chineseName: '日期时间转换器' },
            // { ...baseConverter, chineseName: '整数基转换器' },
            // { ...romanNumeralConverter, chineseName: '罗马数字转换器' },
            { ...base64StringConverter, chineseName: 'Base64 字符串编码/解码' },
            { ...base64FileConverter, chineseName: 'Base64 文件转换器' },
            { ...colorConverter, chineseName: 'Color 选择器' },
            { ...caseConverter, chineseName: '大小写转换' },
            // { ...textToNatoAlphabet, chineseName: '文本转北约字母表' },
            { ...textToBinary, chineseName: '文本到 ASCII 二进制' },
            // { ...textToUnicode, chineseName: '文本转 Unicode' },
            { ...yamlToJson, chineseName: 'YAML到JSON转换器' },
            // { ...yamlToToml, chineseName: 'YAML 到 TOML' },
            { ...jsonToYaml, chineseName: 'JSON到YAML转换器' },
            // { ...jsonToToml, chineseName: 'JSON 转 TOML' },
            // { ...listConverter, chineseName: 'List 转换器' },
            // { ...tomlToJson, chineseName: 'TOML 到 JSON' },
            // { ...tomlToYaml, chineseName: 'TOML 到 YAML' },
            { ...xmlToJson, chineseName: 'XML 到 JSON' },
            { ...jsonToXml, chineseName: 'JSON 到 XML' },
            { ...markdownToHtml, chineseName: 'Markdown 到 HTML' },
        ],
    },
    {
        name: 'Web',
        components: [
            // { ...urlEncoder, chineseName: '编码/解码url格式的字符串' },
            { ...htmlEntities, chineseName: '转义html实体' },
            { ...urlParser, chineseName: 'Url分析器' },
            { ...deviceInformation, chineseName: '设备信息' },
            // { ...basicAuthGenerator, chineseName: '基本身份验证生成器' },
            // { ...metaTagGenerator, chineseName: '开放式图形元生成器' },
            // { ...otpCodeGeneratorAndValidator, chineseName: 'OTP代码生成器' },
            { ...mimeTypes, chineseName: 'mime类型' },
            { ...jwtParser, chineseName: 'JWT 解析器' },
            // { ...keycodeInfo, chineseName: 'Keycode 信息' },
            // { ...slugifyString, chineseName: '打乱字符串' },
            { ...htmlWysiwygEditor, chineseName: 'HTML所见即所得编辑器' },
            { ...userAgentParser, chineseName: '用户代理分析器' },
            { ...httpStatusCodes, chineseName: 'HTTP 状态码' },
            { ...jsonDiff, chineseName: 'JSON 差异比较' },
            // { ...safelinkDecoder, chineseName: '安全链接解码器' },
        ],
    },
    // {
    //     name: 'Images and videos',
    //     components: [
    //         { ...qrCodeGenerator, chineseName: '二维码生成器' },
    //         { ...wifiQrCodeGenerator, chineseName: 'WiFi 二维码生成器' },
    //         { ...svgPlaceholderGenerator, chineseName: 'SVG 占位符生成器' },
    //         { ...cameraRecorder, chineseName: '摄像机记录器' },
    //     ],
    // },
    {
        name: 'Development',
        components: [
            { ...gitMemo, chineseName: 'Git 备忘录' },
            // { ...randomPortGenerator, chineseName: '随机端口生成' },
            { ...jsonViewer, chineseName: 'JSON 查看器' },
            { ...jsonMinify, chineseName: 'JSON 压缩' },
            { ...jsonToCsv, chineseName: 'JSON 转 CSV' },
            { ...sqlPrettify, chineseName: 'SQL 美化和格式化' },
            { ...xmlFormatter, chineseName: 'XML 格式化' },
            { ...yamlViewer, chineseName: 'YAML 查看器' },
            // { ...emailNormalizer, chineseName: '邮箱标准化' },
            // { ...regexTester, chineseName: '正则表达式测试器' },
            // { ...regexMemo, chineseName: '正则表达式备忘录' },
        ],
    },

    // {
    //     name: 'Math',
    //     components: [
    //         { ...mathEvaluator, chineseName: '数学计算器' },
    //         { ...etaCalculator, chineseName: 'ETA 计算器' },
    //         { ...percentageCalculator, chineseName: '百分比计算器' },
    //     ],
    // },
    // {
    //     name: 'Measurement',
    //     components: [
    //         { ...chronometer, chineseName: '计时器' },
    //         { ...temperatureConverter, chineseName: '温度转换器' },
    //         { ...benchmarkBuilder, chineseName: '基准生成器' },
    //     ],
    // },
    {
        name: 'Text',
        components: [
            // { ...loremIpsumGenerator, chineseName: 'Lorem ipsum生成器' },
            { ...textStatistics, chineseName: '文本统计' },
            { ...emojiPicker, chineseName: 'Emoji 选择器' },
            // { ...stringObfuscator, chineseName: '字符串混淆器' },
            { ...textDiff, chineseName: '文本比较' },
            // { ...numeronymGenerator, chineseName: '数字名称生成器' },
            // { ...asciiTextDrawer, chineseName: 'ASCII 文本绘制器' },
            { ...textKeywordRemover, chineseName: '文本关键字删除器' },
        ],
    },
    // {
    //     name: 'Data',
    //     components: [phoneParserAndFormatter, ibanValidatorAndParser],
    // },
];

export const tools = toolsByCategory.flatMap(({ components }) => components);
export const toolsWithCategory = toolsByCategory.flatMap(({ components, name }) =>
    components.map(tool => ({ category: name, ...tool })),
);
